package com.heima.user.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.LoginDto;
import com.heima.user.service.IApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author WSJ
 * @Date 2022-03-15-15:06
 * @Version 1.0 （版本号）
 */
@RestController
@RequestMapping("/api/v1/login")
@Api(tags = "APP用户登录接口")
public class LoginController {

    @Autowired
    private IApUserService apUserService;

    /**
     * 用户手机号密码登录
     * @param dto
     * @return
     */
    @ApiOperation(value = "用户手机号密码登录",notes = "author:wsj")
    @ApiImplicitParam(name = "dto",value = "登录参数",required = true,dataType = "LoginDto")
    @PostMapping("/login_auth")
    public ResponseResult login(@RequestBody LoginDto dto) {
        return apUserService.login(dto);
    }
}
